package com.zwb.boot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zwb.boot.entity.OrderDetail;
import com.zwb.boot.mapper.OrderDetailMapper;
import com.zwb.boot.service.OrderDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 头发又黑又长
 * @Date 2022/7/26 19:16
 * @email zwb15083976291@163.com
 */
@Slf4j
@Service
@Transactional
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail>
        implements OrderDetailService {


    /**
     * 通过订单id 查询 订单详情
     *
     * @param id
     * @return
     */
    @Override
    public List<OrderDetail> findByOrderId(Long id) {
        LambdaQueryWrapper<OrderDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(OrderDetail::getOrderId, id);
        return this.list(queryWrapper);
    }
}
